package mes.kanban.respository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import mes.kanban.entity.MesConfigList;

@Repository
public interface ConfigListRespository extends BaseJpaRespository<MesConfigList, String>{

	@Query(" from MesConfigList where pollingConfigId = ?1 and showOrder != -1  order by showOrder")
	public List<MesConfigList> getConfigListByPolingConfigId(String polingConfigId);
	
	@Query(" from MesConfigList where pollingConfigId = ?1 order by showOrder")
	public List<MesConfigList> getConfigListByPolingConfigIdAndForShow(String polingConfigId);
	

	@Query("from MesConfigList where materialId = ? order by showOrder")
	public List<MesConfigList> getConfigListByMaterialId(String materialId);
	
	@Query("select max(showOrder) from MesConfigList where pollingConfigId = ? ")
	public Integer findMaxShowOrder(String pollingConfigId);
	
}
